//
//  IntroductionViewCell.m
//  ChineseCollegeStudentsNetwork
//
//  Created by 魏苏扬 on 2018/8/9.
//  Copyright © 2018年 刘喆. All rights reserved.
//

#import "IntroductionViewCell.h"
@interface IntroductionViewCell()
@property (nonatomic, strong) UILabel *titleLabel;
@end

@implementation IntroductionViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if(self){
        [self setupUI];
        [self setupLayout];
    }
    return self;
}
#pragma mark- UI
- (void)setupUI{
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.textColor = UIColorFromRGBHex(0x666666);
    self.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
    self.titleLabel.numberOfLines = 0;
}

- (void)setupLayout{
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(10);
        make.left.mas_equalTo(16);
        make.right.mas_equalTo(-10);
        make.bottom.mas_equalTo(0);
    }];
}
- (void)setTitle:(NSString *)title {
    _title = title;
    NSAttributedString *content = [[NSAttributedString alloc] initWithData:[title dataUsingEncoding:NSUnicodeStringEncoding] options:@{NSDocumentTypeDocumentAttribute:NSHTMLTextDocumentType} documentAttributes:nil error:nil];
    self.titleLabel.attributedText = content;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
